﻿ CREATE proc [dbo].[danhmucKhoanMucPhi_sua]        
@Ma_KMuc varchar(25),        
@Ten_KMuc nvarchar(200),    
@Malh varchar(25),
@Ma_KMucMoi varchar(25)        
as        
declare @dem as int            
select @dem=COUNT(*) from  dbo.DM_KhoanMucChiPhi where Ma_KMuc=@Ma_KMucMoi and  Ma_KMuc <> @Ma_KMuc         
if(@dem>0)            
begin            
select ErrCode=0            
          
end            
else            
begin            
            
update  DM_KhoanMucChiPhi set Ten_KMuc =@Ten_KMuc,Malh=@Malh  where  Ma_KMuc=@Ma_KMuc         
select ErrCode=1            
end   